<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.16"></script>
</head>

<body>
    <div id="app">
        <div class="container">
            <div v-for="i in 10" ::key="i">这是一条弹幕消息+++{{da}}</div>
        </div>
    </div>

</body>
<script>
    var vue=  new Vue({
        el: '#app',
        data() {
            return {
                da:'11111'
            }
        },
        created() {
            this.onchage()
        },
        methods: {
            onchage() {
                const danmu = document.querySelector('.danmu');
                danmu.addEventListener('animationiteration', () => {
                    setTimeout(() => {
                        danmu.style.animationPlayState = 'paused';
                        setTimeout(() => {
                            danmu.style.animationPlayState = 'running';
                        }, 1000);
                    }, 2500); // 50% of 5s animation duration
                });
            }
        },

    });


</script>

<style>
    .container {
        position: relative;
        width: 200px;
        height: 200px;
        overflow: hidden;
        background-color: pink;
    }

    .danmu {
        position: absolute;
        bottom: 0;
        animation: slide-up 5s forwards;
    }

    @keyframes slide-up {
        0% {
            bottom: 0;
        }

        50% {
            bottom: 100px;
        }

        100% {
            bottom: 200px;
        }
    }
</style>

</html>